package com.tchhy.provider.api

import com.tchhy.provider.URLConstant
import com.tchhy.provider.data.common.BaseResp
import com.tchhy.provider.data.common.EmptyResp
import com.tchhy.provider.data.partner.response.DataListRes
import com.tchhy.provider.data.profit.response.IncomeBreakdownRes
import com.tchhy.provider.data.profit.response.IncomeRes
import com.tchhy.provider.data.profit.response.SettlementIncomeRes
import com.tchyy.provider.data.BindBankInfo
import com.tchyy.provider.data.CashRecord
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author: admin
 * @date: 2019/8/20
 * @des:接口
 *
 **/
interface ProfitApi {
    /**
     *@description 发送验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    @POST(URLConstant.SEND_SMS)
    fun sendCaptcha(@Body body: RequestBody): Observable<EmptyResp>

    /**
     * 绑定的银行卡列表
     */
    @GET(URLConstant.BANK_CARD_LIST)
    fun bankCardList(): Observable<BaseResp<List<BindBankInfo>>>

    /**
     * 绑定银行卡
     */
    @POST(URLConstant.BIND_BANK_CARD)
    fun bindBankCard(@Body body: RequestBody): Observable<EmptyResp>

    /**
     * 解绑定银行卡
     */
    @DELETE(URLConstant.UNBIND_BANK_CARD)
    fun unbindBankCard(@Query("bankCardId") bankCardId:Long): Observable<EmptyResp>

    /**
     * 提现申请
     */
    @POST(URLConstant.CASH_APPLY)
    fun cashApply(@Body body: RequestBody): Observable<BaseResp<Boolean>>

    /**
     * 提现记录
     */
    @GET(URLConstant.CASH_RECORD_LIST)
    fun cashRecordList(@Query("pageNum") pageNum:Int, @Query("pageSize") pageSize:Int): Observable<BaseResp<DataListRes<CashRecord>>>

    /**
     * 我的收益
     */
    @GET(URLConstant.MY_INCOME)
    fun myIncome(): Observable<BaseResp<IncomeRes>>


    /**
     * 结算详情
     */
    @GET(URLConstant.SETTLEMENT_DETAILS_BY_ID)
    fun settlementDetailsById(
        @Query("settlementId") settlementId: Long
    ): Observable<BaseResp<IncomeBreakdownRes>>


    /**
     * 结算单列表
     */
    @GET(URLConstant.BILL_LIST)
    fun billList(
        @Query("pageNum") pageNum:Int, @Query("pageSize") pageSize:Int
    ): Observable<BaseResp<DataListRes<IncomeBreakdownRes>>>

    /**
     * 账单详情明细列表
     */
    @GET(URLConstant.DETAILED_LIST_OF_BENEFITS)
    fun detailedListOfBenefits(
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int,
        @Query("startTime") startTime: String,
        @Query("endTime") endTime: String,
        @Query("serviceType") serviceType: Int,
        @Query("serviceId") serviceId: Long
    ): Observable<BaseResp<DataListRes<SettlementIncomeRes>>>

    /**
     * 收益列表
     */
    @GET(URLConstant.INCOME_BREAKDOWN_LIST)
    fun incomeBreakdownList(
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int,
        @Query("date")  date: String?,
        @Query("type") type: Int?
    ): Observable<BaseResp<DataListRes<SettlementIncomeRes>>>
}